/*
 * @Description: 头部
 * @Author: iamsmiling
 * @Date: 2021-06-09 06:31:22
 * @LastEditTime: 2021-06-10 21:20:00
 */
import 'dart:ui';

import 'package:credit_business_circle/R/R.dart';
import 'package:credit_business_circle/components/image/chimera_image.dart';
import 'package:credit_business_circle/routes/app_routes.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class StarPartnerHeader extends StatelessWidget {
  const StarPartnerHeader({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      color: R.color.ffffffff,
      width: R.dimen.width,
      padding: EdgeInsets.only(top: R.dimen.dp22, bottom: R.dimen.dp24),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Row(
            children: [
              Container(
                margin:
                    EdgeInsets.only(left: R.dimen.dp12, right: R.dimen.dp12),
                child: ChimeraImage(
                  src: "https://i.loli.net/2021/04/20/E5SK9ahjTvM3tqN.png",
                  width: R.dimen.dp30,
                  height: R.dimen.dp30,
                  borderRadius: BorderRadius.circular(R.dimen.dp30 / 2),
                ),
              ),
              Container(
                margin: EdgeInsets.only(right: R.dimen.dp12),
                child: Text(
                  "不会游泳",
                  style: TextStyle(
                      fontSize: R.dimen.sp16,
                      fontWeight: FontWeight.w600,
                      color: R.color.ff222222),
                ),
              ),
              Row(
                  children: List.generate(
                      3,
                      (index) => Container(
                            margin: EdgeInsets.only(right: R.dimen.dp6),
                            child: Image.asset(R.image.star),
                          )))
            ],
          ),
          Container(
            padding: EdgeInsets.only(
                top: R.dimen.dp20,
                bottom: R.dimen.dp28,
                left: R.dimen.dp13,
                right: R.dimen.dp13),
            child: Text.rich(TextSpan(
                text: "成为信商圈合伙人后邀请注册的直属成员和间接成进行充值可获得星币（兑换比例：",
                style:
                    TextStyle(fontSize: R.dimen.sp14, color: R.color.ff222222),
                children: [
                  TextSpan(
                      text: "1星币=1元",
                      style: TextStyle(fontWeight: FontWeight.w600)),
                  TextSpan(text: "）并可进行提现。")
                ])),
          ),
          Container(
            padding: EdgeInsets.symmetric(horizontal: R.dimen.dp32),
            child: ElevatedButton(
              onPressed: () => Get.toNamed(Get.currentRoute + AppRoutes.kpi),
              child: Text("查看星币业绩"),
              style: ButtonStyle(
                textStyle: MaterialStateProperty.all(
                    TextStyle(fontSize: R.dimen.sp16)),
                padding: MaterialStateProperty.all(
                    EdgeInsets.symmetric(vertical: R.dimen.dp13)),
                elevation: MaterialStateProperty.all(0),
                overlayColor: MaterialStateProperty.all(R.color.transparent),
                shape: MaterialStateProperty.all(RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(R.dimen.sp5))),
              ),
            ),
          )
        ],
      ),
    );
  }
}
